<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./js/echarts.min.js"></script>
  <script src="./js/world.js"></script>

  <style>
    .box {
      width: 600px;
      height: 400px;
      border: 1px solid #333;
    }
  </style>
</head>

<body>
  <div class="box"></div>


</body>

<script type="module">
  import { dataMap } from "./js/dataMap.js"
  import { nameMap } from "./js/nameMap.js"

  // import "./js/world.js"

  // console.log(echarts, "@@@")
  let myChart = echarts.init(document.querySelector(".box"))
  let option = {
    tooltip: {
      // 设置提示信息触发源
      trigger: "item",
      // 设置提示信息格式
      formatter: function (params) {
        return params.name + " : " + (params.value ? params.value : 0);
      },
    },
    series: [
      {
        name: "",
        data: dataMap,
        nameMap: nameMap,
        type: "map",
        mapType: "world",
        itemStyle: {

          emphasis: {
            areaColor: "red",
            label: {
              show: false
            }

          }
        },
        layoutCenter: ["50%", "50%"],
        layoutSize: "120%"


      }
    ]

  }
  myChart.setOption(option)
</script>

</html>